//
//  Function02_VC.m
//  Hwi_Library_Demo
//
//  Created by Jeonghwi Kim on 13. 7. 5..
//  Copyright (c) 2013년 KDML. All rights reserved.
//

#import "Function02_VC.h"


@implementation Function02_VC
- (IBAction)on_btn_json_network:(id)sender
{
    [self.hwi hwi02_json_network_url:URL_OPEN_API parameter_dic:nil method:@"GET" callback:self log_id:@"log_01" is_second_try_for_same_time:NO];


}
- (IBAction)on_btn_json_network_has_param:(id)sender
{

    NSDictionary *params_dic = [NSDictionary dictionaryWithObjectsAndKeys:@"55",@"lat",@"37",@"lon",@"10",@"cnt", nil];
    [self.hwi hwi02_json_network_url:URL_OPEN_API_PARAM_TEST parameter_dic:params_dic method:@"GET" callback:self log_id:@"log_02" is_second_try_for_same_time:YES];
}
- (IBAction)on_btn_back:(id)sender
{
    [self.navigationController popViewControllerAnimated:YES];
}

- (IBAction)on_btn_json_network_blocl:(id)sender
{
    [self.hwi hwi02_json_network_url:URL_OPEN_API parameter_dic:nil method:@"GET" log_id:@"log_03" is_second_try_for_same_time:NO with_block:^(NSDictionary *dic) {
        self.label03_result.text = [NSString stringWithFormat:@"%@",dic];
    }];

}




-(void)hwi02_did_receive_data_from_json_network:(NSDictionary*)json_data string_data:(NSString*)string log_id:(NSString *)log_id
{
    if([log_id isEqualToString:@"log_01"])
    {
        self.label01_result.text = string;
    }
    else if([log_id isEqualToString:@"log_02"])
    {
        self.label02_result.text = string;
    }
    
}




- (void)viewDidLoad
{
    [super viewDidLoad];
    self.hwi = [Hwi get_instance];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
